import React, { useState, useEffect } from 'react'
import { NavBar, Collapse, Toast ,Tabs} from 'antd-mobile'
import { useNavigate } from 'react-router-dom'
import axios from 'axios'
import Liebiao from '../../Compution/Liebiao'
import qx from '../../img/qx.png'
function Index() {
    const navigate = useNavigate()
    const [list, setList] = useState([])
    const xuanRan = async () => {
        const res = await axios.get('/api/list')
        console.log(res, 'res===')
        const { code, data, message } = res.data
        if (code == 200) {
            Toast.show(message)
            setList([...list, ...data])
        }
    }
    useEffect(() => {
        xuanRan()
    }, [])
    return (
        <div>
            <NavBar onBack={() => navigate('/')}>我的预定</NavBar>
               <Tabs>
                <Tabs.Tab title='活动状态' key='fruits'>
                      <Liebiao></Liebiao>
          </Tabs.Tab>
          <Tabs.Tab title='活动时间' key='vegetables'>
           
          </Tabs.Tab>
          <Tabs.Tab title='已取消' key='animals'>
             <img src={qx} alt="" />
          </Tabs.Tab>
        </Tabs>
          
        </div>
    )
}

export default Index
